package org.zoomdev.zoom.web.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Mapping {

    String POST = "POST";
    String GET = "GET";
    String PUT = "PUT";
    String DELETE = "DELETE";
    String OPTIONS = "OPTIONS";
    String[] ALL = new String[]{GET, POST, PUT, DELETE, OPTIONS};


    /**
     * 路由的路径,  这个只能用于方法，与Spring不同, 具体结果为
     * {@link Controller#key} + "/" + name
     *
     * @return
     * @see Controller
     */
    String value() default "";

    /**
     * 默认不限制method
     *
     * @return
     */
    String[] method() default {GET, POST};

}
